package com.olive.controller;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

import com.olive.vo.ArticleRequestVO;
import org.apache.commons.io.FileUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

	@RequestMapping("/getArticle")
	public Map<String, Object> getArticle(){
		Map<String, Object> result = new HashMap<>();
		result.put("code", 200);
		result.put("msg", "success");
		byte[] bytes = null;
		try {
			bytes = FileUtils.readFileToByteArray(new File("C:\\Users\\2230\\Desktop\\凯平项目资料\\改装车项目\\CXSSBOOT_DB_DDL-1.0.9.sql"));
		}catch (Exception e){

		}
		String content = new String(bytes);
		ArticleRequestVO vo = new ArticleRequestVO();
		vo.setId(1L);
		vo.setTitle("BUG弄潮儿");
		vo.setContent(content);
		result.put("body", vo);
		return result;
	}

}
